<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form>
      <p>name <input type="text" name="uname" /></p>
      <p>email <input type="text" name="email" /></p>
      <p>phone <input type="text" name="phone" /></p>
    </form>
    <script>
      // document.querySelectorAll('form')
      console.log(document.forms[0]);
      console.log(document.forms[0].elements);
      console.log(document.forms[0].elements[0]);
      console.log(document.forms[0].elements.uname);
      console.log(document.forms[0].elements[1]);
      console.log(document.forms[0].elements.email);
      console.log(document.forms[0].elements["phone"]);
    </script>
  </body>
</html>
